package main

import (
	"GO/controller"
	"GO/middleware"

	"github.com/gin-gonic/gin"
)

func CollectRouter(r *gin.Engine) *gin.Engine {
	//注册时的接口
	r.POST("/api/Sign", controller.Sign)
	r.POST("/api/Login", controller.Login)
	//使用中间件来保护接口
	r.GET("/api/info", middleware.AuthMiddleware(), controller.Info)
	//获取用户信息列表的
	r.GET("/api/user_list", middleware.AuthMiddleware(), controller.GetUserList)
	//修改用户状态
	r.PUT("/api/user_status", middleware.AuthMiddleware(), controller.Modifying_Status)
	//获取温度
	r.GET("/api/tep", middleware.AuthMiddleware(), controller.Get_Tep)
	//获取湿度
	r.GET("/api/hum", middleware.AuthMiddleware(), controller.Get_Hum)
	return r
}
